﻿using SXICE.Core.Domains;
using SXICE.Core.Models;
using SXICE.Core.Models.Search;

namespace SXICE.IRepository
{
    /// <summary>
    /// 医生仓储接口
    /// </summary>
    public interface IDoctorRepository
    {
        /// <summary>
        /// 通过名字获取用户信息
        /// </summary>
        /// <param name="name">用户昵称</param>
        /// <returns>结果</returns>
        ReturnResult<Doctor> GetOneByName(string name);

        /// <summary>
        /// 搜索
        /// </summary>
        /// <param name="pageListQuery">查询条件</param>
        /// <returns></returns>
        ReturnPageListResult<Doctor> Search(PageListQuery<RecordSearchModel> pageListQuery);

        /// <summary>
        /// 根据角色ID查询是否存在相应的用户
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>结果</returns>
        ReturnResult ExistsByRoleId(int roleId);

        /// <summary>
        /// 插入医生
        /// </summary>
        /// <param name="obj">医生信息</param>
        /// <returns></returns>
        ReturnResult<bool> InsertOne(Doctor obj);

        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="doctor">要更新的医生</param>
        /// <returns>结果</returns>
        ReturnResult<bool> UpdateRole(Doctor doctor);

        /// <summary>
        /// 根据ID删除医生
        /// </summary>
        /// <param name="id">要删除的医生ID</param>
        /// <param name="state">状态</param>
        /// <returns>结果</returns>
        ReturnResult<bool> DeleteDoctor(int id, bool state);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="doctor">要修改密码的医生</param>
        /// <returns>结果</returns>
        ReturnResult<bool> UpdatePassword(Doctor doctor);

        /// <summary>
        /// 是否可用
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns>结果</returns>
        ReturnResult IsEnabled(int id);

        /// <summary>
        /// 通过Id获取一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ReturnResult<Doctor> GetOneById(int id);

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="doctor">信息</param>
        /// <returns></returns>
        ReturnResult<bool> UpdateObject(Doctor doctor);
    }
}
